import hljs from 'highlight.js'
import type { App } from 'vue'

export const hl = (App: App) => {
  App.directive('hl', (el) => {
    let blocks = el.querySelectorAll('pre code')
    blocks.forEach((block: HTMLElement) => {
      hljs.highlightBlock(block)
    })
  })
}
